package com.rd.student.jiaji.class1.jinhongyu._0713;

public class Student_0713 implements Comparable {

    private String name;
    private int age;
    private int score;

    public Student_0713(String name, int age, int score) {
        this.age = age;
        this.name = name;
        this.score = score;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int compareTo(Object o) {
        Student_0713 s = (Student_0713) o;
        if (this.score > s.score) {
            return -1;
        } else if (this.score < s.score) {
            return 1;
        } else {
            if (this.age > s.age) {
                return 1;
            } else if (this.age < s.age) {
                return -1;
            }
            return 0;
        }
    }
}

